package com.itheima.interface2;

public class Test {

    public static void main(String[] args) {

        //接口的好处:

        //1.一个类可以实现多个接口，弥补了单继承的不足，使类的角色更多、功能更丰富。
        Person p = new Student();
        Driver d = new Student();  //多态
        Cook c = new Student();

        //2.接口实现面向接口编程，更利于解耦合
         Driver driver = new Student();

         Cook cook = new Teacher();
    }
}

class Person {

}

interface Driver {

}

interface Cook{

}

class Student extends Person implements Driver, Cook{

}

class Teacher extends Person implements Driver,Cook{

}